package com.yuan.model_app.rest;

import com.yuan.model_app.rest.resp.ShowActivityResp;
import com.yuan.model_app.rest.resp.ShowPageDateResp;
import com.yuan.model_app.rest.resp.ShowRepairComplaintResp;
import com.yuan.model_app.rest.resp.UserHouseInfoResp;
import com.yuan.model_app.service.ManageShowDataService;
import com.yuan.model_app.service.UserAppService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.annotation.Log;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "物业便民: 首页数据展示")
@RestController
@RequestMapping("/api/show/page")
@RequiredArgsConstructor
public class ShowPageDataController {

    private final ManageShowDataService manageShowDataService;

    @GetMapping("/finShowPageData")
    @Log("查询/api/user/show/page/data")
    @ApiOperation("查询/user/show/page/data")
    public ResponseEntity<ShowPageDateResp> queryShowPageDataList() {
        ShowPageDateResp showPageDateResp = manageShowDataService.showPageDate();
        List<ShowActivityResp> showActivityResps = manageShowDataService.showActivity();
        List<ShowRepairComplaintResp> showRepairComplaintResps = manageShowDataService.showPageRepairComplaint();
        showPageDateResp.setActivityNum(showActivityResps);
        showPageDateResp.setRcCountNum(showRepairComplaintResps);
        return new ResponseEntity<>(showPageDateResp, HttpStatus.OK);
    }

}
